package config

import (
	"github.com/Tkanos/gonfig"
)

func NewConfig(path string) *Config {
	return &Config{
		path: path,
		// instance: instance,
	}
}

type Config struct {
	path     string
	instance any
}

// # 属性方法

func (r *Config) Path(path string) *Config {
	r.path = path

	return r
}
func (r *Config) GetPath() string {
	return r.path
}

// # 封装

func (r *Config) GetConfig(config any) {
	err := gonfig.GetConf(r.path, config)
	if err != nil {
		panic(err)
	}
}
